package org.wdaogang.jcrawl.config;

import java.util.Properties;

import org.wdaogang.jcrawl.model.IResult;
import org.wdaogang.jcrawl.service.CrawlServiceImpl;
import org.wdaogang.jcrawl.service.ICrawlParser;
import org.wdaogang.jcrawl.service.ICrawlService;
import org.wdaogang.jcrawl.service.ProcessingManager;
import org.wdaogang.jcrawl.service.RegexCrawParser;

public class DefaultServiceProvider implements ServiceProvider {
	private Properties tables;
	@Override
	public ICrawlService fetchService() {
		if(tables.containsKey(Constants.index_keys)){
			String value=tables.getProperty(Constants.index_keys);
			if(Constants.INDEX_KEYS_REGEX.equalsIgnoreCase(value)){
				ICrawlService service=new CrawlServiceImpl();
				String v_initialUrl=tables.getProperty(Constants.INITIAL_URL);
				
				return service;
			}
		}
		return null;
	}



	@Override
	public void initConfigs(IConfiguration configuration) {
		// TODO Auto-generated method stub
		
	}

}
